/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * <p>Project: RabbitMQ - Consumer</p>
 * <p>Powered by yzc On 2023-12-23 14:32:25</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@Component
public class Consumer {
    /**
     * 监听对列一
     * @param message
     */
    @RabbitListener(queues = {"queueOne"})
   public void handler(Message message){
       System.out.println("消费者取队列One中消息"+new String(message.getBody()));
   }

    /**
     * 监听对列二
     * @param message
     */
    @RabbitListener(queues = {"queueTwo"})
    public void handler2(Message message){
        System.out.println("消费者取队列Two中消息"+new String(message.getBody()));
    }

}
